package com.mickey.access;

import com.mickey.domain.MiaoshaUser;

/**
 * @Desc:当前用户
 * @Author:czx
 * @CreateDate:2019/1/11 0011$ 20:18$
 */
public class UserContext {
    private static ThreadLocal<MiaoshaUser> userHolder = new ThreadLocal<>();

    public static void setUser(MiaoshaUser user){
        userHolder.set(user);
    }

    public static MiaoshaUser getUser(){
        return userHolder.get();
    }

}
